<template>
  <div class="goods-list-view">
    <div class="goods-list-title">{{ props.goods_list?.cat_small_name }}</div>
    <van-row :gutter="[10, 15]">
      <van-col 
       span="12" 
       v-for="item in props.goods_list?.goods_list" 
       :key="item.goods_id"
       ><Goods :goods="item"></Goods></van-col>
    </van-row>
    <van-divider @click="seeMore">查看更多></van-divider>
  </div>
</template>

<script setup lang="ts">
  import { useBaseStore } from '../../store';
  let baseStore = useBaseStore();
  let router = useRouter()

  let seeMore = async()=>{
    await baseStore.getClassifyDataList(props.goods_list?.cat_id);
    router.push({ path: '/classifysmall', query: { product_content: props.goods_list?.cat_small_name }})
  }

  const props = defineProps({
    goods_list: Object
  });

</script>

<style scoped lang="less">
  .goods-list-view{
    width: 95%;
    margin: 0 auto;
    .goods-list-title{
      font-size: 24px;
      font-weight: bold;
      margin: 10px 0;
    }
  }
</style>